package com.dragonfly.shutter.DAOIbatisImpls;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.dragonfly.shutter.DAOs.ScoreDAO;
import com.dragonfly.shutter.beans.Score;

public class ScoreDAOIbatisImpl extends SqlMapClientDaoSupport implements ScoreDAO {

	public int deleteScoreByPictureID(String pictureID) {
		return this.getSqlMapClientTemplate().delete("deleteScoreByPictureID", pictureID);
	}

	public Integer insertScore(Score score) {
		return (Integer) this.getSqlMapClientTemplate().insert("insertScore", score);
	}

	public int updateScoreByScoreId(Score score) {
		return this.getSqlMapClientTemplate().update("updateScoreByScoreId", score);
	}

	public Integer selectScoreNumber(String pictureID) {
		return (Integer) this.getSqlMapClientTemplate().queryForObject("selectScoreNumber", pictureID);
	}

	@Override
	public Score selectPictureScore(Score score) {
		return (Score) this.getSqlMapClientTemplate().queryForObject("selectPictureScore", score);
	}

}
